<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../新建文件夹 (5)/abc/node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <!--vue场景（模板）-->
        <input :type="msg">
        <button @click="change">点击</button>
    </div>
    <script>
      new Vue({
            el: '#app', // 不能绑定body、html
            data: {
                msg: 'text',
            },
            methods:{
                change(){
                    if(this.msg==="text"){
                    this.msg="password"
                    }
                    else {
                        this.msg="text"
                    }
                }
            }
        })
       

    </script>
</body>
</html>